<template>
    <br>
    <video src="https://vjs.zencdn.net/v/oceans.mp4" controls width="600" ref="video"></video>
    <button @click="toggle">全屏</button>
    <p>
        Used: {{ size(memory?.usedJSHeapSize) }}
    </p>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useFullscreen, useMemory } from "@vueuse/core"

const video = ref()
const { toggle, isFullscreen } = useFullscreen(video)

const { memory } = useMemory()

const size = (num: number) => {
    return (num / 1024 / 1024).toFixed(2) + ' MB'
}

</script>

